﻿<UserControl x:Class="Output.Views.OutputView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
						 >
	<Grid xmlns:ae="clr-namespace:ICSharpCode.AvalonEdit.Edi;assembly=ICSharpCode.AvalonEdit"
        xmlns:edi_cmd="clr-namespace:ICSharpCode.AvalonEdit.Edi;assembly=ICSharpCode.AvalonEdit"
        xmlns:aedit_cmd="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
				xmlns:cmdLabel="clr-namespace:Output.Local"
				>
		<Grid.Resources>
			<BooleanToVisibilityConverter x:Key="boolToVis" />
		</Grid.Resources>

		<!-- Known problem: Options must be bound or the control will show a gray bar otherwise -->
		<ae:EdiTextEditor  DataContext="{Binding Path=Text}"
                        Document="{Binding Document}"
                        Options="{Binding TextOptions}"
                        SyntaxHighlighting="{Binding HighlightingDefinition, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                       
                        EditorCaretOffset="{Binding TextEditorCaretOffset, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                        EditorSelectionLength="{Binding TextEditorSelectionLength, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                        EditorSelectionStart="{Binding TextEditorSelectionStart, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                        EditorIsRectangleSelection="{Binding TextEditorIsRectangularSelection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                        EditorScrollOffsetX="{Binding TextEditorScrollOffsetX, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                        EditorScrollOffsetY="{Binding TextEditorScrollOffsetY, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"

                        FontSize="{Binding Path=SizeUnitLabel.ScreenPoints, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"

                        WordWrap="{Binding Path=WordWrap, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                        ShowLineNumbers="False"

                        IsModified="{Binding Path=IsDirty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                        IsReadOnly="True"

                        TextBoxController="{Binding TxtControl}"
                        Line="{Binding Line, Mode=OneWayToSource}"
                        Column="{Binding Column, Mode=OneWayToSource}"
                        Margin="3,1,3,0"
                        >
			<ae:EdiTextEditor.ContextMenu>
				<ContextMenu>
					<MenuItem Command="Copy" Header="{x:Static cmdLabel:Strings.STR_CmdName_Copy}"
                    ToolTip="{x:Static cmdLabel:Strings.STR_CmdName_Copy_TT}">
						<!-- MenuItem.Icon>
                    <Image Source="{StaticResource Image_Copy}" Height="16"/>
                  </MenuItem.Icon -->
					</MenuItem>

					<MenuItem Command="SelectAll" Header="{x:Static cmdLabel:Strings.STR_CmdName_SelectAll}"
                      ToolTip="{x:Static cmdLabel:Strings.STR_CmdName_SelectAll_TT}"/>
				</ContextMenu>
			</ae:EdiTextEditor.ContextMenu>
		</ae:EdiTextEditor>
	</Grid>
</UserControl>